package com.CST.service.impl.zx;

import com.CST.dto.zx.AuditDTO;
import com.CST.dto.zx.ProSelDTO;
import com.CST.entity.zx.ZX_Audit;
import com.CST.mapper.cst.zx.ZX_AuditMapper;
import com.CST.service.zx.IZX_AuditService;
import com.CST.vo.zx.ZxAuditVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class ZX_AuditServiceImp implements IZX_AuditService {


    @Autowired
    ZX_AuditMapper zxAuditMapper;

    @Override
    public List<ZxAuditVO> getList(ProSelDTO proSelDTO) {
        return zxAuditMapper.getList(proSelDTO);
    }

    @Override
    public void addAudit(ZX_Audit audit) {
        zxAuditMapper.addAudit(audit);
    }

    @Override
    public Integer audit(AuditDTO auditVO) {
        ZX_Audit info =new ZX_Audit();
        BeanUtils.copyProperties(auditVO,info);
        info.setUpdateTime(LocalDateTime.now());
        return zxAuditMapper.audit(info);
    }
}
